package org.keyintegrity.webbeans;

import javax.xml.bind.annotation.XmlEnum;

@XmlEnum
public enum JaxbEnum {
    EnumName1("Enum Value 1"),
    EnumName2("Enum Value 2");
    
    private final String value;

    JaxbEnum(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static JaxbEnum fromValue(String v) {
        for (JaxbEnum e: JaxbEnum.values()) {
            if (e.value.equals(v)) {
                return e;
            }
        }
        throw new IllegalArgumentException(v.toString());
    }
}
